-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Unable to edit time_bound access codes #656
fix: Unable to edit time_bound access codes #656
Conversation
@@ -173,7 +173,7 @@ function Content({ | |||
: null | |||
|
|||
const hasCodeInputs = | |||
accessCode?.type !== 'time_bound' || accessCode.is_offline_access_code | |||
accessCode?.type !== 'time_bound' && accessCode?.is_offline_access_code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this new condition mean that the UI will only allow editing offline access codes? What about editing online access codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mastafit I am looking at the thread, but it doesn't answer my original question. Can you answer my original question per the intent of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@razor-x You are right, I think we can add extra conditions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean remove the extra condition, something like that:
const hasCodeInputs = accessCode?.type !== 'time_bound'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mastafit This might help.
Code inputs were intentionally hidden for offline codes: #606
But the current (and updated) logic also hides it for other code kinds. That appears like a mistake. What if we only hide the inputs when for the offline code case?
const hasCodeInputs = accessCode.is_offline_access_code !== ture
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I have updated the code!
if (start === null || start === undefined) { | ||
throw new Error(`Invalid start date: ${startDate.invalidReason}`) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (start === null || start === undefined) { | |
throw new Error(`Invalid start date: ${startDate.invalidReason}`) | |
} | |
if (start === null) { | |
throw new Error(`Invalid start date: ${startDate.invalidReason}`) | |
} |
throw new Error(`Invalid start date: ${startDate.invalidReason}`) | ||
} | ||
|
||
const end = endDate.toISO() | ||
if (end == null) { | ||
if (end === null || end === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (end === null || end === undefined) { | |
if (end === null) { |
{hasCodeInputs !== null && | ||
hasCodeInputs !== undefined && | ||
hasCodeInputs && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{hasCodeInputs !== null && | |
hasCodeInputs !== undefined && | |
hasCodeInputs && ( | |
{hasCodeInputs && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's redundant, I have removed it now
No description provided.